#ifndef AST_EXPRESSION_EQUALITY_EXPR_H
#define AST_EXPRESSION_EQUALITY_EXPR_H

#include "../ASTNode.h"

class RelationalExpr;
/*
C99 6.5.9
equality-expression:
		relational-expression
		equality-expression    ==    relational-expression
		equality-expression    !=    relational-expression
*/
class EqualityExpr : public ASTNode
{
public:
	enum{
		single_expr,
		equal_expr,
		no_equal_expr
	};
protected:
	EqualityExpr(void)
		:ASTNode(ASTNode::equality_expression){};
public:
	explicit EqualityExpr(RelationalExpr *pSingleExpr)
		: ASTNode(ASTNode::equality_expression)
		, m_iType(single_expr)
		, m_pSingleExpr(pSingleExpr){};
	EqualityExpr(EqualityExpr *pEqExpr, int iType, RelationalExpr *pRlaExpr)
		: ASTNode(ASTNode::equality_expression)
		, m_iType(iType)
		, m_pEqExpr(pEqExpr)
		, m_pRlaExpr(pRlaExpr){};


	virtual ~EqualityExpr(void);

	virtual void						codeGen();

protected:
	tiny_int				m_iType;
	union{
		RelationalExpr *		m_pSingleExpr;
		struct{
			EqualityExpr *		m_pEqExpr;
			RelationalExpr *	m_pRlaExpr;
		};
	};
};


#endif


